#include "HandlerFactory.h"

HandlerFactory::HandlerFactory()
{
    this->handlerMap["checkUpdateHandler"]=checkUpdateHandler::getInstance();
    this->handlerMap["UpdateHandler"]=UpdateHandler::getInstance();
}

RequestHandler *HandlerFactory::getHandler(string type)
{
    if ("check"==type)
    {
        return checkUpdateHandler::getInstance();
    }else if ("updata"==type)
    {
        return UpdateHandler::getInstance();
    }else
    {
        throw runtime_error("没有这个类型");
    }
}
